<include file="Public:header"/>
<div class="autobox">
	<div class="now">
		<a href="/" class="orange">首页</a> &gt; <a href="/user/index.html" class="orange">安全中心 </a> &gt; 修改登录密码
	</div>
	<div class="assets_center clear po_re zin70">
		<!--左侧菜单-->
		<include file="User:left"/>
		<!--右侧内容-->
		<div class="assets_content w900 right bg_w">
			<div class="safe_center clear" style="padding-left: 0px; border-bottom: 2px solid #E55600;">
				<h1 style="margin-top: 0px; margin-bottom: 15px; line-height: 15px;">修改登录密码</h1>
			</div>
			<notempty name="prompt_text">
				<div class="mytips">
					<h6 style="color: #FF8000;">温馨提示</h6>
					{$prompt_text}
				</div>
			</notempty>
			<br/>
			<div class="pwtrade">
				<form id="form-pw" class="pw">
					<dl>
						<dt>登录密码：</dt>
						<dd>
							<input type="password" id="oldpassword">
						</dd>
					</dl>
					<dl>
						<dt>新登录密码：</dt>
						<dd>
							<input type="password" id="newpassword">
						</dd>
					</dl>
					<dl>
						<dt>再次输入新密码：</dt>
						<dd>
							<input type="password" id="repassword">
						</dd>
					</dl>			
                    <dl>
                        <dt>获取验证码：</dt>
                        <dd class="yuyin">
                            <div class="clear">
                                <input id="regBtn" type="button" class="getyzm" value="免费获取验证码" onclick="SendCode()" style="width: 160px;">
                            </div>
                        </dd>
                    </dl>
                    <dl>
                        <dt>短信验证码：</dt>
                        <dd>
                            <input type="text" id="moble_verify">
                        </dd>
                    </dl>
					<dl>
						<dt></dt>
						<dd>
							<input type="button" value="保存" onclick="Update()">
						</dd>
					</dl>
				</form>
			</div>
		</div>
	</div>
</div><br><br>
<script>
	$('input').focus(function () {
		var t = $(this);
		if (t.attr('type') == 'text' || t.attr('type') == 'password')
			t.css({'box-shadow': '0px 0px 3px #1583fb', 'border': '1px solid #1583fb', 'color': '#333'});
		if (t.val() == t.attr('placeholder'))
			t.val('');
	});
	$('input').blur(function () {
		var t = $(this);
		if (t.attr('type') == 'text' || t.attr('type') == 'password')
			t.css({'box-shadow': 'none', 'border': '1px solid #e1e1e1', 'color': '#333'});
		if (t.attr('type') != 'password' && !t.val())
			t.val(t.attr('placeholder'));
	});
	function SendCode() {
        $.post("/Verify/moble.html", {
        }, function (data) {
            if (data.status == 1) {
                //刷新验证码
                $(".reloadverify").click();
                $("#verify").val('');
                $('#regBtn').attr("disabled", "disabled");
                layer.msg(data.info, {icon: 1});
                var obj = $('#regBtn');
                var wait = 60;
                var interval = setInterval(function () {
                    obj.css('backgroundColor', '#999B9C');
                    obj.val(wait + '秒再次发送');
                    wait--;
                    if (wait < 0) {
                        clearInterval(interval);
                        obj.val('获取验证码');
						$('#regBtn').removeAttr("disabled");
                        obj.css('backgroundColor', '#e55600');
                    }
                    ;
                }, 1000);
            } else {
                layer.msg(data.info, {icon: 2});
                if (data.url) {
                    window.location = data.url;
                }
            }
        }, "json");
    }

	function Update() {
		$.post("{:U('User/uppassword')}", {
			oldpassword: $('#oldpassword').val(),
			newpassword: $('#newpassword').val(),
			repassword: $('#repassword').val(),
			moble_verify: $('#moble_verify').val()
		}, function (data) {
			if (data.status == 1) {
				layer.msg(data.info, {icon: 1});
				window.location = "{:U('User/password')}";
			} else {
				layer.msg(data.info, {icon: 2});
				if (data.url) {
					window.location = data.url;
				}
			}
		}, "json");
	}
</script>
<script>

	$('#user_box').addClass('active');
	$('#user_password').addClass('active');
	$('#user_password i').attr('class', 'coin_menu_op_9');
</script>
<include file="Public:footer"/>